<?php
if (!(defined('IN_IA')))
{
    exit('Access Denied');
}
/**
 * User: 邓志锋 <280160522@qq.com> <http://www.diygw.com>
 * Date: 2018-07-28
 * Time: 下午 6:06
 */
class Interceptor_Diygwcom extends DiygwcomAction
{
    public function __construct($_init = true)
    {
        if ($_init)
        {
            $flag = $this->init();
            if(!$flag){
                exit();
            }
        }
        parent::__construct();
    }

    private function init()
    {
        global $_GPC, $_W;
        $dashboardid = $_GPC["dashboardid"];

        if(empty($dashboardid)){
            $isajax = $_GPC["__isajax__"];
            $isxcx = $_GPC["__isxcx__"];
            if($isajax=='true'||$isxcx=='true'){
                echo json_encode(['status'=>'401','message'=>'访问应用不存在']);

            }else{
                $message="访问应用不存在";
                include $this->template("login/perror");
            }
            return false;
        }
        return true;
    }




    public function getUid(){
        global $_W;
        $uid = MODULE_DEBUG?1:$_W['fans']['uid'];
        return $uid;
    }
}